home *** CD-ROM | disk | FTP | other *** search
Text File | 2000-09-18 | 1.1 KB | 45 lines | [TEXT/ToyS] |
- -- Input values
- set targetColumn to 2 -- the index of the target column
- set the newValue to 123 -- the new value of the last row
-
- set repeatNTimes to 0
-
- -- Execute
- repeat with i from targetColumn to (targetColumn + repeatNTimes)
- ShiftOneRowUp(i, newValue)
- end repeat
-
- ---------------------
- on ShiftOneRowUp(targetColumn, newValue)
- tell application "KnowledgeMiner 3.2"
- activate
-
- -- find rowindex of the last value in target column
- set lastrow to (rowIndex of second cell of column targetColumn whose kind is not "valuecell") - 1
-
- --copy first value to clipbord
- select cell 2 of column targetColumn
- copy
-
- --read values of target column to valueList
- set valueList to (value of every cell of column targetColumn whose rowIndex is greater than 2 ¬
- and rowIndex is less than or equal to lastrow)
-
- -- how many values were read
- set n to count valueList
-
- -- write values of valueList to new location
- set value of cells 2 thru (1 + n) of column targetColumn to valueList
-
- -- write new value to last row of target column
- set value of cell lastrow of column targetColumn to newValue
-
- end tell
- end ShiftOneRowUp
-
-
-
-
-
-
-